package com.syh.userservice;

import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.syh.feignapi.clients.CompanyClient;
import com.syh.feignapi.config.DefaultFeignConfig;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@SpringBootApplication
@EnableDiscoveryClient
@EnableKnife4j
@EnableFeignClients(defaultConfiguration = DefaultFeignConfig.class,clients = CompanyClient.class) //开启feign客户端功能
public class UserServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserServiceApplication.class, args);
    }
    @Bean
    public ApplicationRunner runner(Environment env) {
        return args -> {
            System.out.println("Nacos server address: " + env.getProperty("spring.cloud.nacos.server-addr"));
        };
    }

}
